import { reactive } from "vue";
import { getListApi } from "@/api/configCenter/warehouseCode";
import { getListApi as getAllCountryApi } from "@/api/configCenter/countryRegion";
import { getCustomerSelectList } from "@/api/managementCenter/customerManagement";
import { getAllCompanyApi, getUserByPositionApi } from "@/api/managementCenter/departmentPersonnel";
import { getTreeChannelApi } from "@/api/configCenter/warehouseEntryChannel";
import { getListApi as outWarehouseBrokerIdsApi } from "@/api/configCenter/outBoundAgent/index";
import { getListApi as warehosueManagementApi } from "@/api/managementCenter/warehosueManagement";
import { TreeSelect } from "ant-design-vue";
const SHOW_CHILD = TreeSelect.SHOW_CHILD;
export const searchItemList: Array<SuperSearch.SearchItem> = [
  {
    type: "input",
    label: "关键字",
    keyName: "keyWordsList",
    placeholder: "支持批量(空格/逗号隔开)"
  },
  {
    type: "input",
    label: "运单号",
    keyName: "waybillNumList",
    placeholder: "支持批量(空格/逗号隔开)"
  },
  {
    type: "input",
    label: "FBA单号",
    keyName: "fbaNumberList",
    placeholder: "支持批量(空格/逗号隔开)"
  },
  {
    type: "input",
    label: "转单号",
    keyName: "transferOrderNumberList",
    placeholder: "支持批量(空格/逗号隔开)"
  },
  reactive<SuperSearch.SearchItem>({
    type: "select",
    label: "业务员",
    keyName: "bizIdList",
    optionsRequest: getUserByPositionApi,
    optReqParams: { position: "4", status: 1, pageNum: 1, pageSize: 9999999, total: 0 },
    optReqCb: (res: Base.GeneraDataType, row: SuperSearch.SearchItem) => {
      const { code, data } = res;
      if (code === 200) {
        row.options = data.records || [];
      }
    },
    optConfig: {
      label: "username",
      value: "id"
    },
    attrs: {
      mode: "multiple"
    },
    options: []
  }),
  reactive<SuperSearch.SearchItem>({
    type: "select",
    label: "跟单员",
    keyName: "followIdList",
    optionsRequest: getUserByPositionApi,
    optReqParams: { position: "5", status: 1, pageNum: 1, pageSize: 9999999, total: 0 },
    optReqCb: (res: Base.GeneraDataType, row: SuperSearch.SearchItem) => {
      const { code, data } = res;
      if (code === 200) {
        row.options = data.records || [];
      }
    },
    optConfig: {
      label: "username",
      value: "id"
    },
    attrs: {
      mode: "multiple"
    },
    options: []
  }),
  reactive<SuperSearch.SearchItem>({
    type: "cascader",
    label: "渠道",
    keyName: "channelIdList",
    optionsRequest: getTreeChannelApi,
    optReqParams: {},
    optReqCb: (res: Base.GeneraDataType, row: SuperSearch.SearchItem) => {
      const { code, data } = res;
      if (code === 200) {
        row.options = data || [];
      }
    },
    optConfig: {
      label: "label",
      value: "value",
      children: "children"
    },
    attrs: {
      multiple: true,
      showCheckedStrategy: SHOW_CHILD
    },
    options: []
  }),
  reactive<SuperSearch.SearchItem>({
    type: "select",
    label: "仓库代码",
    keyName: "warehouseCodeList",
    optionsRequest: getListApi,
    optReqParams: { status: 1, pageNum: 1, pageSize: 9999999, total: 0 },
    optReqCb: (res: Base.GeneraDataType, row: SuperSearch.SearchItem) => {
      const { code, data } = res;
      if (code === 200) {
        row.options = data.records || [];
      }
    },
    optConfig: {
      label: "warehouseCode",
      value: "warehouseCode"
    },
    attrs: {
      mode: "multiple"
    },
    options: []
  }),

  {
    type: "dict-select",
    label: "标识",
    keyName: "markList",
    lookupCode: "LOGOTYPE",
    optConfig: {
      label: "name",
      value: "code"
    },
    attrs: {
      mode: "multiple"
    },
    options: []
  },
  {
    type: "dict-select",
    label: "未标识",
    keyName: "notMark",
    lookupCode: "LOGOTYPE",
    optConfig: {
      label: "name",
      value: "code"
    },
    options: []
  },
  reactive<SuperSearch.SearchItem>({
    type: "select",
    label: "客户简称",
    keyName: "customerIdList",
    optionsRequest: getCustomerSelectList,
    optReqParams: { isFilterChild: 0 },
    optReqCb: (res: Base.GeneraDataType, row: SuperSearch.SearchItem) => {
      const { code, data } = res;
      if (code === 200) {
        row.options = data || [];
      }
    },
    attrs: {
      mode: "multiple"
    },
    optConfig: {
      label: "shortName",
      value: "id"
    },
    options: []
  }),
  {
    type: "select",
    label: "制作发票",
    keyName: "makeInvoiceStatus",
    optConfig: {
      label: "name",
      value: "code"
    },
    options: [
      {
        name: "未制作",
        code: -1
      },
      {
        name: "已制作",
        code: -2
      }
    ]
  },
  {
    type: "input",
    label: "邮编",
    keyName: "zipCode"
  },
  reactive<SuperSearch.SearchItem>({
    type: "select",
    label: "目的地",
    keyName: "countryRegionIdList",
    optionsRequest: getAllCountryApi,
    optReqParams: { status: 1, pageNum: 1, pageSize: 9999999, total: 0 },
    optReqCb: (res: Base.GeneraDataType, row: SuperSearch.SearchItem) => {
      const { code, data } = res;
      if (code === 200) {
        row.options = data.records || [];
      }
    },
    optConfig: {
      label: "region",
      value: "id"
    },
    attrs: {
      mode: "multiple"
    },
    options: []
  }),
  {
    type: "dict-select",
    label: "交税方式",
    keyName: "customsTaxesTypeList",
    lookupCode: "TAX_PAYMENT_METHOD",
    optConfig: {
      label: "name",
      value: "code"
    },
    attrs: {
      mode: "multiple"
    },
    options: []
  },
  {
    type: "dict-select",
    label: "报关方式",
    keyName: "customsDeclarationType",
    lookupCode: "CUSTOMS_DECLARATION_METHOD",
    optConfig: {
      label: "name",
      value: "code"
    },
    options: []
  },
  {
    type: "input",
    label: "内部备注",
    keyName: "innerRemark"
  },
  {
    type: "input",
    label: "客户备注",
    keyName: "remark"
  },
  {
    type: "datetimerange",
    label: "下单时间",
    keyName: "createdTime"
  },
  {
    type: "datetimerange",
    label: "拣货时间",
    keyName: "depositTime"
  },
  reactive<SuperSearch.SearchItem>({
    type: "select",
    label: "经营单位",
    keyName: "companyIds",
    optionsRequest: getAllCompanyApi,
    optReqParams: { status: 1, pageNum: 1, pageSize: 9999999, total: 0 },
    optReqCb: (res: Base.GeneraDataType, row: SuperSearch.SearchItem) => {
      const { code, data } = res;
      if (code === 200) {
        row.options = data || [];
      }
    },
    attrs: {
      mode: "multiple"
    },
    optConfig: {
      label: "name",
      value: "id"
    },
    options: []
  }),
  reactive<SuperSearch.SearchItem>({
    type: "select",
    label: "出仓代理",
    keyName: "outWarehouseBrokerIds",
    optionsRequest: outWarehouseBrokerIdsApi,
    optReqParams: { pageNum: 1, pageSize: 999, beforePageNum: 0, name: "", total: 0, status: undefined },
    optReqCb: (res: Base.GeneraDataType, row: SuperSearch.SearchItem) => {
      const { code, data } = res;
      if (code === 200) {
        row.options = data.records || [];
      }
    },
    attrs: {
      mode: "multiple"
    },
    optConfig: {
      label: "name",
      value: "id"
    },
    options: []
  }),
  {
    type: "datetimerange",
    label: "出仓时间",
    keyName: "outWarehouseTime"
  },
  // reactive<SuperSearch.SearchItem>({
  //   type: "select",
  //   label: "拣货仓库",
  //   keyName: "warehouseNameList",
  //   optionsRequest: warehouseCodeApi,
  //   optReqParams: { status: 1, pageNum: 1, pageSize: 9999999, total: 0 },
  //   optReqCb: (res: Base.GeneraDataType, row: SuperSearch.SearchItem) => {
  //     const { code, data } = res;
  //     if (code === 200) {
  //       row.options = data.records || [];
  //     }
  //   },
  //   attrs: {
  //     mode: "multiple"
  //   },
  //   optConfig: {
  //     label: "warehouseCode",
  //     value: "warehouseCode"
  //   },
  //   options: []
  // }),
  {
    type: "select",
    label: "是否推单",
    keyName: "pushOrderSuccess",
    optConfig: {
      label: "name",
      value: "code"
    },
    options: [
      {
        name: "是",
        code: "1"
      },
      {
        name: "否",
        code: "0"
      }
    ]
  },
  {
    type: "dict-select",
    label: "仓库属性",
    keyName: "warehousePropertyList",
    lookupCode: "WAREHOUSE_PROPERT",
    optConfig: {
      label: "name",
      value: "name"
    },
    attrs: {
      mode: "multiple"
    },
    options: []
  },
  {
    type: "dict-select",
    label: "问题类型",
    keyName: "questionType",
    lookupCode: "QUESTION_SCOPE",
    optConfig: {
      label: "name",
      value: "code"
    },
    options: []
  },
  reactive<SuperSearch.SearchItem>({
    type: "select",
    label: "拣货仓库",
    keyName: "warehouseNameList",
    optionsRequest: warehosueManagementApi,
    optReqParams: { status: 1, pageNum: 1, pageSize: 9999999, total: 0 },
    optReqCb: (res: Base.GeneraDataType, row: SuperSearch.SearchItem) => {
      const { code, data } = res;
      if (code === 200) {
        row.options = data || [];
      }
    },
    attrs: {
      mode: "multiple"
    },
    optConfig: {
      label: "cnName",
      value: "cnName"
    },
    options: []
  }),
  {
    type: "input",
    label: "合并报关",
    keyName: "mergeNoList",
    placeholder: "支持批量(空格/逗号隔开)"
  }
];

export const tableColumnMap: Base.GeneraDataType<Array<SuperTable.TableCoulmnItem | SuperTable.NestTableColumnItem>> = {
  "5": [
    {
      type: "checkbox",
      field: "checkbox",
      minWidth: "50"
    },
    {
      field: "customerName",
      title: "客户简称",
      minWidth: "120",
      sortable: true
    },
    {
      field: "fbaNumber",
      title: "FBA单号",
      minWidth: "140"
    },
    {
      field: "waybillNum",
      title: "运单号",
      minWidth: "260",
      renderSlot: "waybillNum"
    },
    {
      field: "questionType",
      title: "问题类型",
      minWidth: "100"
    },
    {
      field: "workOrderNo",
      title: "工单",
      minWidth: "100"
    },
    {
      field: "trackState",
      title: "运踪状态",
      minWidth: "90",
      renderSlot: "trackState"
    },
    {
      field: "declaredValue",
      title: "申报总值",
      minWidth: "90"
    },
    {
      field: "mergeNo",
      title: "合并报关号",
      minWidth: "90"
    },
    {
      field: "splitFoamRatio",
      title: "泡比",
      minWidth: "90"
    },
    {
      field: "customsDeclarationType",
      title: "报关方式",
      minWidth: "90",
      renderSlot: "customsDeclarationType"
    },
    {
      field: "warehouseProperty",
      title: "仓库属性",
      minWidth: "90",
      sortable: true
    },
    {
      field: "annexNumber",
      title: "附件个数",
      minWidth: "90"
    },

    {
      field: "warehouseName",
      title: "拣货仓库",
      minWidth: "110",
      sortable: true
    },

    {
      field: "tracksStatus",
      title: "最新轨迹",
      minWidth: "160"
    },
    {
      field: "locusUpdateTime",
      title: "轨迹更新时间",
      minWidth: "135",
      formatter: "formatDate",
      sortable: true
    },
    {
      field: "pushOrderTag",
      title: "推单状态",
      minWidth: "110"
    },
    {
      field: "countryRegionName",
      title: "目的地",
      minWidth: "90",
      sortable: true
    },
    {
      field: "transferOrderNumber",
      title: "转单号",
      minWidth: "150",
      renderSlot: "transferOrderNumber"
    },
    {
      field: "courierCompanies",
      title: "快递公司",
      minWidth: "90",
      sortable: true
    },
    {
      field: "warehouseCode",
      title: "仓库代码",
      minWidth: "100"
    },
    {
      field: "receivableFeePrice",
      title: "应收费用",
      minWidth: "90"
    },

    {
      field: "channelName",
      title: "渠道",
      minWidth: "160",
      sortable: true
    },
    {
      field: "agentChannelName",
      title: "代理渠道",
      minWidth: "160"
    },
    {
      field: "outWarehouseBrokerName",
      title: "代理",
      minWidth: "100",
      sortable: true
    },
    {
      field: "itemNumber",
      title: "件数",
      minWidth: "80"
    },
    {
      field: "mark",
      title: "标识",
      minWidth: "80"
    },
    {
      field: "settlementWeight",
      title: "结算重",
      minWidth: "80"
    },
    {
      field: "actualWeight",
      title: "实重",
      minWidth: "80"
    },
    {
      field: "volumeWeight",
      title: "材积重",
      minWidth: "80"
    },
    {
      field: "squaresNumber",
      title: "方数",
      minWidth: "80"
    },
    {
      field: "zipCode",
      title: "邮编",
      minWidth: "90"
    },
    {
      field: "productName",
      title: "品名",
      minWidth: "120"
    },
    {
      field: "materialQualityName",
      title: "材质",
      minWidth: "120"
    },
    // {
    //   field: "companyName",
    //   title: "公司名称",
    //   minWidth: "120"
    // },
    {
      field: "remark",
      title: "客户备注",
      minWidth: "120"
    },
    {
      field: "innerRemark",
      title: "内部备注",
      minWidth: "120"
    },
    {
      field: "customerServiceRemark",
      title: "客服备注",
      minWidth: "120"
    },
    {
      field: "makeInvoiceStatus",
      title: "制作发票",
      minWidth: "120",
      renderSlot: "makeInvoiceStatus",
      sortable: true
    },
    {
      field: "depositTime",
      title: "拣货时间",
      minWidth: "135",
      formatter: "formatDate",
      sortable: true
    },
    {
      field: "bizName",
      title: "业务员",
      minWidth: "90",
      sortable: true
    },
    {
      field: "followName",
      title: "跟单员",
      minWidth: "90",
      sortable: true
    },
    {
      field: "addressType",
      title: "运单类型",
      minWidth: "120",
      fixed: "right",
      renderSlot: "addressType",
      sortable: true
    },
    {
      field: "companyName",
      title: "经营单位",
      minWidth: "100",
      sortable: true
    },
    {
      field: "action",
      title: "操作",
      minWidth: "90",
      renderSlot: "action",
      fixed: "right"
    }
  ],
  "6": [
    {
      type: "checkbox",
      field: "checkbox",
      minWidth: "50"
    },
    {
      field: "customerName",
      title: "客户简称",
      minWidth: "120",
      sortable: true
    },
    {
      field: "fbaNumber",
      title: "FBA单号",
      minWidth: "140"
    },
    {
      field: "waybillNum",
      title: "运单号",
      minWidth: "260",
      renderSlot: "waybillNum"
    },
    {
      field: "questionType",
      title: "问题类型",
      minWidth: "100"
    },
    {
      field: "workOrderNo",
      title: "工单",
      minWidth: "100"
    },
    {
      field: "trackState",
      title: "运踪状态",
      minWidth: "90",
      renderSlot: "trackState"
    },
    {
      field: "declaredValue",
      title: "申报总值",
      minWidth: "90"
    },
    {
      field: "mergeNo",
      title: "合并报关号",
      minWidth: "90"
    },
    {
      field: "splitFoamRatio",
      title: "泡比",
      minWidth: "90"
    },
    {
      field: "customsDeclarationType",
      title: "报关方式",
      minWidth: "90",
      renderSlot: "customsDeclarationType"
    },
    {
      field: "warehouseProperty",
      title: "仓库属性",
      minWidth: "90",
      sortable: true
    },
    {
      field: "annexNumber",
      title: "附件个数",
      minWidth: "90"
    },

    {
      field: "warehouseName",
      title: "拣货仓库",
      minWidth: "110",
      sortable: true
    },
    {
      field: "tracksStatus",
      title: "最新轨迹",
      minWidth: "160"
    },
    {
      field: "locusUpdateTime",
      title: "轨迹更新时间",
      minWidth: "135",
      formatter: "formatDate",
      sortable: true
    },
    {
      field: "pushOrderTag",
      title: "推单状态",
      minWidth: "110"
    },
    {
      field: "countryRegionName",
      title: "目的地",
      minWidth: "90",
      sortable: true
    },
    {
      field: "transferOrderNumber",
      title: "转单号",
      minWidth: "150",
      renderSlot: "transferOrderNumber"
    },
    {
      field: "courierCompanies",
      title: "快递公司",
      minWidth: "90",
      sortable: true
    },
    {
      field: "warehouseCode",
      title: "仓库代码",
      minWidth: "100"
    },
    {
      field: "receivableFeePrice",
      title: "应收费用",
      minWidth: "90"
    },

    {
      field: "outWarehouseBrokerName",
      title: "代理",
      minWidth: "100",
      sortable: true
    },
    {
      field: "channelName",
      title: "渠道",
      minWidth: "160",
      sortable: true
    },
    {
      field: "agentChannelName",
      title: "代理渠道",
      minWidth: "160"
    },
    {
      field: "itemNumber",
      title: "件数",
      minWidth: "80"
    },
    {
      field: "mark",
      title: "标识",
      minWidth: "80"
    },
    {
      field: "settlementWeight",
      title: "结算重",
      minWidth: "80"
    },
    {
      field: "actualWeight",
      title: "实重",
      minWidth: "80"
    },
    {
      field: "volumeWeight",
      title: "材积重",
      minWidth: "80"
    },
    {
      field: "squaresNumber",
      title: "方数",
      minWidth: "80"
    },
    {
      field: "zipCode",
      title: "邮编",
      minWidth: "90"
    },
    {
      field: "productName",
      title: "品名",
      minWidth: "120"
    },
    {
      field: "materialQualityName",
      title: "材质",
      minWidth: "120"
    },
    // {
    //   field: "companyName",
    //   title: "公司名称",
    //   minWidth: "120"
    // },

    {
      field: "remark",
      title: "客户备注",
      minWidth: "120"
    },
    {
      field: "innerRemark",
      title: "内部备注",
      minWidth: "120"
    },
    {
      field: "customerServiceRemark",
      title: "客服备注",
      minWidth: "120"
    },
    {
      field: "makeInvoiceStatus",
      title: "制作发票",
      minWidth: "120",
      renderSlot: "makeInvoiceStatus",
      sortable: true
    },
    {
      field: "depositTime",
      title: "拣货时间",
      minWidth: "135",
      formatter: "formatDate",
      sortable: true
    },
    {
      field: "bizName",
      title: "业务员",
      minWidth: "90",
      sortable: true
    },
    {
      field: "followName",
      title: "跟单员",
      minWidth: "90",
      sortable: true
    },
    {
      field: "addressType",
      title: "运单类型",
      minWidth: "120",
      fixed: "right",
      renderSlot: "addressType",
      sortable: true
    },
    {
      field: "companyName",
      title: "经营单位",
      minWidth: "120",
      sortable: true
    },
    {
      field: "action",
      title: "操作",
      minWidth: "90",
      renderSlot: "action",
      fixed: "right"
    }
  ],

  "7": [
    {
      type: "checkbox",
      field: "checkbox",
      minWidth: "50"
    },
    {
      field: "customerName",
      title: "客户简称",
      minWidth: "120",
      sortable: true
    },
    {
      field: "fbaNumber",
      title: "FBA单号",
      minWidth: "140"
    },
    {
      field: "waybillNum",
      title: "运单号",
      minWidth: "260",
      renderSlot: "waybillNum"
    },
    {
      field: "questionType",
      title: "问题类型",
      minWidth: "100"
    },
    {
      field: "workOrderNo",
      title: "工单",
      minWidth: "100"
    },
    {
      field: "trackState",
      title: "运踪状态",
      minWidth: "90",
      renderSlot: "trackState"
    },
    {
      field: "declaredValue",
      title: "申报总值",
      minWidth: "90"
    },
    {
      field: "mergeNo",
      title: "合并报关号",
      minWidth: "90"
    },
    {
      field: "splitFoamRatio",
      title: "泡比",
      minWidth: "90"
    },
    {
      field: "customsDeclarationType",
      title: "报关方式",
      minWidth: "90",
      renderSlot: "customsDeclarationType"
    },
    {
      field: "warehouseProperty",
      title: "仓库属性",
      minWidth: "90",
      sortable: true
    },
    {
      field: "annexNumber",
      title: "附件个数",
      minWidth: "90"
    },

    {
      field: "warehouseName",
      title: "拣货仓库",
      minWidth: "110",
      sortable: true
    },

    {
      field: "tracksStatus",
      title: "最新轨迹",
      minWidth: "160"
    },
    {
      field: "locusUpdateTime",
      title: "轨迹更新时间",
      minWidth: "135",
      formatter: "formatDate",
      sortable: true
    },
    {
      field: "pushOrderTag",
      title: "推单状态",
      minWidth: "110"
    },
    {
      field: "countryRegionName",
      title: "目的地",
      minWidth: "90",
      sortable: true
    },
    {
      field: "transferOrderNumber",
      title: "转单号",
      minWidth: "150",
      renderSlot: "transferOrderNumber"
    },
    {
      field: "courierCompanies",
      title: "快递公司",
      minWidth: "90",
      sortable: true
    },
    {
      field: "warehouseCode",
      title: "仓库代码",
      minWidth: "100"
    },
    {
      field: "receivableFeePrice",
      title: "应收费用",
      minWidth: "90"
    },

    {
      field: "outWarehouseBrokerName",
      title: "代理",
      minWidth: "100",
      sortable: true
    },
    {
      field: "channelName",
      title: "渠道",
      minWidth: "160",
      sortable: true
    },
    {
      field: "agentChannelName",
      title: "代理渠道",
      minWidth: "160"
    },
    {
      field: "itemNumber",
      title: "件数",
      minWidth: "80"
    },
    {
      field: "mark",
      title: "标识",
      minWidth: "80"
    },
    {
      field: "settlementWeight",
      title: "结算重",
      minWidth: "80"
    },
    {
      field: "actualWeight",
      title: "实重",
      minWidth: "80"
    },
    {
      field: "volumeWeight",
      title: "材积重",
      minWidth: "80"
    },
    {
      field: "squaresNumber",
      title: "方数",
      minWidth: "80"
    },
    {
      field: "zipCode",
      title: "邮编",
      minWidth: "90"
    },
    {
      field: "productName",
      title: "品名",
      minWidth: "120"
    },
    {
      field: "materialQualityName",
      title: "材质",
      minWidth: "120"
    },
    // {
    //   field: "companyName",
    //   title: "公司名称",
    //   minWidth: "120"
    // },

    {
      field: "remark",
      title: "客户备注",
      minWidth: "120"
    },
    {
      field: "innerRemark",
      title: "内部备注",
      minWidth: "120"
    },
    {
      field: "customerServiceRemark",
      title: "客服备注",
      minWidth: "120"
    },
    {
      field: "makeInvoiceStatus",
      title: "制作发票",
      minWidth: "120",
      renderSlot: "makeInvoiceStatus",
      sortable: true
    },
    {
      field: "depositTime",
      title: "拣货时间",
      minWidth: "135",
      formatter: "formatDate",
      sortable: true
    },
    {
      field: "bizName",
      title: "业务员",
      minWidth: "90",
      sortable: true
    },
    {
      field: "followName",
      title: "跟单员",
      minWidth: "90",
      sortable: true
    },
    {
      field: "addressType",
      title: "运单类型",
      minWidth: "120",
      fixed: "right",
      renderSlot: "addressType",
      sortable: true
    },
    {
      field: "companyName",
      title: "经营单位",
      minWidth: "100",
      sortable: true
    },
    {
      field: "action",
      title: "操作",
      minWidth: "90",
      renderSlot: "action",
      fixed: "right"
    }
  ],
  "8": [
    {
      type: "checkbox",
      field: "checkbox",
      minWidth: "50"
    },
    {
      field: "customerName",
      title: "客户简称",
      minWidth: "120",
      sortable: true
    },
    {
      field: "fbaNumber",
      title: "FBA单号",
      minWidth: "140"
    },
    {
      field: "waybillNum",
      title: "运单号",
      minWidth: "260",
      renderSlot: "waybillNum"
    },
    {
      field: "questionType",
      title: "问题类型",
      minWidth: "100"
    },
    {
      field: "workOrderNo",
      title: "工单",
      minWidth: "100"
    },
    {
      field: "trackState",
      title: "运踪状态",
      minWidth: "90",
      renderSlot: "trackState"
    },
    {
      field: "declaredValue",
      title: "申报总值",
      minWidth: "90"
    },
    {
      field: "mergeNo",
      title: "合并报关号",
      minWidth: "90"
    },
    {
      field: "splitFoamRatio",
      title: "泡比",
      minWidth: "90"
    },
    {
      field: "customsDeclarationType",
      title: "报关方式",
      minWidth: "90",
      renderSlot: "customsDeclarationType"
    },
    {
      field: "warehouseProperty",
      title: "仓库属性",
      minWidth: "90",
      sortable: true
    },
    {
      field: "annexNumber",
      title: "附件个数",
      minWidth: "90"
    },

    {
      field: "warehouseName",
      title: "拣货仓库",
      minWidth: "110",
      sortable: true
    },

    {
      field: "tracksStatus",
      title: "最新轨迹",
      minWidth: "160"
    },
    {
      field: "locusUpdateTime",
      title: "轨迹更新时间",
      minWidth: "135",
      formatter: "formatDate",
      sortable: true
    },
    {
      field: "pushOrderTag",
      title: "推单状态",
      minWidth: "110"
    },
    {
      field: "countryRegionName",
      title: "目的地",
      minWidth: "90",
      sortable: true
    },
    {
      field: "transferOrderNumber",
      title: "转单号",
      minWidth: "150",
      renderSlot: "transferOrderNumber"
    },
    {
      field: "courierCompanies",
      title: "快递公司",
      minWidth: "90",
      sortable: true
    },
    {
      field: "warehouseCode",
      title: "仓库代码",
      minWidth: "100"
    },
    {
      field: "receivableFeePrice",
      title: "应收费用",
      minWidth: "90"
    },

    {
      field: "outWarehouseBrokerName",
      title: "代理",
      minWidth: "100",
      sortable: true
    },
    {
      field: "channelName",
      title: "渠道",
      minWidth: "160",
      sortable: true
    },
    {
      field: "agentChannelName",
      title: "代理渠道",
      minWidth: "160"
    },
    {
      field: "itemNumber",
      title: "件数",
      minWidth: "80"
    },
    {
      field: "mark",
      title: "标识",
      minWidth: "80"
    },
    {
      field: "settlementWeight",
      title: "结算重",
      minWidth: "80"
    },
    {
      field: "actualWeight",
      title: "实重",
      minWidth: "80"
    },
    {
      field: "volumeWeight",
      title: "材积重",
      minWidth: "80"
    },
    {
      field: "squaresNumber",
      title: "方数",
      minWidth: "80"
    },
    {
      field: "zipCode",
      title: "邮编",
      minWidth: "90"
    },
    {
      field: "productName",
      title: "品名",
      minWidth: "120"
    },
    {
      field: "materialQualityName",
      title: "材质",
      minWidth: "120"
    },
    // {
    //   field: "companyName",
    //   title: "公司名称",
    //   minWidth: "120"
    // },

    {
      field: "remark",
      title: "客户备注",
      minWidth: "120"
    },
    {
      field: "innerRemark",
      title: "内部备注",
      minWidth: "120"
    },
    {
      field: "customerServiceRemark",
      title: "客服备注",
      minWidth: "120"
    },
    {
      field: "makeInvoiceStatus",
      title: "制作发票",
      minWidth: "120",
      renderSlot: "makeInvoiceStatus",
      sortable: true
    },
    {
      field: "depositTime",
      title: "拣货时间",
      minWidth: "135",
      formatter: "formatDate",
      sortable: true
    },
    {
      field: "bizName",
      title: "业务员",
      minWidth: "90",
      sortable: true
    },
    {
      field: "followName",
      title: "跟单员",
      minWidth: "90",
      sortable: true
    },
    {
      field: "addressType",
      title: "运单类型",
      minWidth: "120",
      fixed: "right",
      renderSlot: "addressType",
      sortable: true
    },
    {
      field: "companyName",
      title: "经营单位",
      minWidth: "100",
      sortable: true
    },
    {
      field: "action",
      title: "操作",
      minWidth: "90",
      renderSlot: "action",
      fixed: "right"
    }
  ],
  "9": [
    {
      type: "checkbox",
      field: "checkbox",
      minWidth: "50"
    },
    {
      field: "customerName",
      title: "客户简称",
      minWidth: "120",
      sortable: true
    },
    {
      field: "fbaNumber",
      title: "FBA单号",
      minWidth: "140"
    },
    {
      field: "waybillNum",
      title: "运单号",
      minWidth: "260",
      renderSlot: "waybillNum"
    },
    {
      field: "questionType",
      title: "问题类型",
      minWidth: "100"
    },
    {
      field: "workOrderNo",
      title: "工单",
      minWidth: "100"
    },
    {
      field: "trackState",
      title: "运踪状态",
      minWidth: "90",
      renderSlot: "trackState"
    },
    {
      field: "declaredValue",
      title: "申报总值",
      minWidth: "90"
    },
    {
      field: "annexNumber",
      title: "附件个数",
      minWidth: "90"
    },
    {
      field: "mergeNo",
      title: "合并报关号",
      minWidth: "90"
    },
    {
      field: "splitFoamRatio",
      title: "泡比",
      minWidth: "90"
    },
    {
      field: "customsDeclarationType",
      title: "报关方式",
      minWidth: "90",
      renderSlot: "customsDeclarationType"
    },
    {
      field: "warehouseProperty",
      title: "仓库属性",
      minWidth: "90",
      sortable: true
    },
    {
      field: "warehouseName",
      title: "拣货仓库",
      minWidth: "110",
      sortable: true
    },

    {
      field: "tracksStatus",
      title: "最新轨迹",
      minWidth: "160"
    },
    {
      field: "locusUpdateTime",
      title: "轨迹更新时间",
      minWidth: "135",
      formatter: "formatDate",
      sortable: true
    },
    {
      field: "pushOrderTag",
      title: "推单状态",
      minWidth: "110"
    },
    {
      field: "countryRegionName",
      title: "目的地",
      minWidth: "90",
      sortable: true
    },
    {
      field: "transferOrderNumber",
      title: "转单号",
      minWidth: "150",
      renderSlot: "transferOrderNumber"
    },
    {
      field: "courierCompanies",
      title: "快递公司",
      minWidth: "90",
      sortable: true
    },
    {
      field: "warehouseCode",
      title: "仓库代码",
      minWidth: "100"
    },
    {
      field: "receivableFeePrice",
      title: "应收费用",
      minWidth: "90"
    },

    {
      field: "outWarehouseBrokerName",
      title: "代理",
      minWidth: "100",
      sortable: true
    },
    {
      field: "channelName",
      title: "渠道",
      minWidth: "160",
      sortable: true
    },
    {
      field: "agentChannelName",
      title: "代理渠道",
      minWidth: "160"
    },
    {
      field: "itemNumber",
      title: "件数",
      minWidth: "80"
    },
    {
      field: "mark",
      title: "标识",
      minWidth: "80"
    },
    {
      field: "settlementWeight",
      title: "结算重",
      minWidth: "80"
    },
    {
      field: "actualWeight",
      title: "实重",
      minWidth: "80"
    },
    {
      field: "volumeWeight",
      title: "材积重",
      minWidth: "80"
    },
    {
      field: "squaresNumber",
      title: "方数",
      minWidth: "80"
    },
    {
      field: "zipCode",
      title: "邮编",
      minWidth: "90"
    },
    {
      field: "productName",
      title: "品名",
      minWidth: "120"
    },
    {
      field: "materialQualityName",
      title: "材质",
      minWidth: "120"
    },
    // {
    //   field: "companyName",
    //   title: "公司名称",
    //   minWidth: "120"
    // },

    {
      field: "remark",
      title: "客户备注",
      minWidth: "120"
    },
    {
      field: "innerRemark",
      title: "内部备注",
      minWidth: "120"
    },
    {
      field: "customerServiceRemark",
      title: "客服备注",
      minWidth: "120"
    },
    {
      field: "makeInvoiceStatus",
      title: "制作发票",
      minWidth: "120",
      renderSlot: "makeInvoiceStatus",
      sortable: true
    },
    {
      field: "depositTime",
      title: "拣货时间",
      minWidth: "135",
      formatter: "formatDate",
      sortable: true
    },
    {
      field: "bizName",
      title: "业务员",
      minWidth: "90",
      sortable: true
    },
    {
      field: "followName",
      title: "跟单员",
      minWidth: "90",
      sortable: true
    },
    {
      field: "addressType",
      title: "运单类型",
      minWidth: "120",
      fixed: "right",
      renderSlot: "addressType",
      sortable: true
    },
    {
      field: "companyName",
      title: "经营单位",
      minWidth: "100",
      sortable: true
    },
    {
      field: "action",
      title: "操作",
      minWidth: "90",
      renderSlot: "action",
      fixed: "right"
    }
  ],
  "-5": [
    {
      type: "checkbox",
      field: "checkbox",
      minWidth: "50"
    },
    {
      field: "customerName",
      title: "客户简称",
      minWidth: "120",
      sortable: true
    },
    {
      field: "fbaNumber",
      title: "FBA单号",
      minWidth: "140"
    },
    {
      field: "waybillNum",
      title: "运单号",
      minWidth: "260",
      renderSlot: "waybillNum"
    },
    {
      field: "questionType",
      title: "问题类型",
      minWidth: "100"
    },
    {
      field: "workOrderNo",
      title: "工单",
      minWidth: "100"
    },
    {
      field: "trackState",
      title: "运踪状态",
      minWidth: "90",
      renderSlot: "trackState"
    },
    {
      field: "declaredValue",
      title: "申报总值",
      minWidth: "90"
    },
    {
      field: "mergeNo",
      title: "合并报关号",
      minWidth: "90"
    },
    {
      field: "splitFoamRatio",
      title: "泡比",
      minWidth: "90"
    },
    {
      field: "customsDeclarationType",
      title: "报关方式",
      minWidth: "90",
      renderSlot: "customsDeclarationType"
    },
    {
      field: "warehouseProperty",
      title: "仓库属性",
      minWidth: "90",
      sortable: true
    },
    {
      field: "annexNumber",
      title: "附件个数",
      minWidth: "90"
    },

    {
      field: "warehouseName",
      title: "拣货仓库",
      minWidth: "110",
      sortable: true
    },

    {
      field: "tracksStatus",
      title: "最新轨迹",
      minWidth: "160"
    },
    {
      field: "locusUpdateTime",
      title: "轨迹更新时间",
      minWidth: "135",
      formatter: "formatDate",
      sortable: true
    },
    {
      field: "pushOrderTag",
      title: "推单状态",
      minWidth: "110"
    },
    {
      field: "countryRegionName",
      title: "目的地",
      minWidth: "90",
      sortable: true
    },
    {
      field: "transferOrderNumber",
      title: "转单号",
      minWidth: "150",
      renderSlot: "transferOrderNumber"
    },
    {
      field: "courierCompanies",
      title: "快递公司",
      minWidth: "90",
      sortable: true
    },
    {
      field: "warehouseCode",
      title: "仓库代码",
      minWidth: "100"
    },
    {
      field: "receivableFeePrice",
      title: "应收费用",
      minWidth: "90"
    },

    {
      field: "channelName",
      title: "渠道",
      minWidth: "160",
      sortable: true
    },
    {
      field: "agentChannelName",
      title: "代理渠道",
      minWidth: "160"
    },
    {
      field: "itemNumber",
      title: "件数",
      minWidth: "80"
    },
    {
      field: "mark",
      title: "标识",
      minWidth: "80"
    },
    {
      field: "agentStatus",
      title: "代理状态标记",
      minWidth: "110",
      formatter: ({ cellValue }: any) => {
        if (cellValue === 1) return "待通知";
        else if (cellValue === 2) return "已拦截";
        else if (cellValue === 3) return "已出货";
        else return "-";
      }
    },
    {
      field: "settlementWeight",
      title: "结算重",
      minWidth: "80"
    },
    {
      field: "actualWeight",
      title: "实重",
      minWidth: "80"
    },
    {
      field: "volumeWeight",
      title: "材积重",
      minWidth: "80"
    },
    {
      field: "squaresNumber",
      title: "方数",
      minWidth: "80"
    },
    {
      field: "zipCode",
      title: "邮编",
      minWidth: "90"
    },
    {
      field: "productName",
      title: "品名",
      minWidth: "120"
    },
    {
      field: "materialQualityName",
      title: "材质",
      minWidth: "120"
    },
    // {
    //   field: "companyName",
    //   title: "公司名称",
    //   minWidth: "120"
    // },

    {
      field: "remark",
      title: "客户备注",
      minWidth: "120"
    },
    {
      field: "innerRemark",
      title: "内部备注",
      minWidth: "120"
    },
    {
      field: "customerServiceRemark",
      title: "客服备注",
      minWidth: "120"
    },
    {
      field: "makeInvoiceStatus",
      title: "制作发票",
      minWidth: "120",
      renderSlot: "makeInvoiceStatus",
      sortable: true
    },
    {
      field: "depositTime",
      title: "拣货时间",
      minWidth: "135",
      formatter: "formatDate",
      sortable: true
    },
    {
      field: "bizName",
      title: "业务员",
      minWidth: "90",
      sortable: true
    },
    {
      field: "followName",
      title: "跟单员",
      minWidth: "90",
      sortable: true
    },
    {
      field: "addressType",
      title: "运单类型",
      minWidth: "120",
      fixed: "right",
      renderSlot: "addressType",
      sortable: true
    },
    {
      field: "companyName",
      title: "经营单位",
      minWidth: "100",
      sortable: true
    },
    {
      field: "action",
      title: "操作",
      minWidth: "90",
      renderSlot: "action",
      fixed: "right"
    }
  ],
  "0": [
    {
      type: "checkbox",
      field: "checkbox",
      minWidth: "50"
    },
    {
      field: "customerName",
      title: "客户简称",
      minWidth: "120",
      sortable: true
    },
    {
      field: "fbaNumber",
      title: "FBA单号",
      minWidth: "140"
    },
    {
      field: "waybillNum",
      title: "运单号",
      minWidth: "260",
      renderSlot: "waybillNum"
    },
    {
      field: "questionType",
      title: "问题类型",
      minWidth: "100"
    },
    {
      field: "workOrderNo",
      title: "工单",
      minWidth: "100"
    },
    {
      field: "trackState",
      title: "运踪状态",
      minWidth: "90",
      renderSlot: "trackState"
    },
    {
      field: "declaredValue",
      title: "申报总值",
      minWidth: "90"
    },
    {
      field: "mergeNo",
      title: "合并报关号",
      minWidth: "90"
    },
    {
      field: "splitFoamRatio",
      title: "泡比",
      minWidth: "90"
    },
    {
      field: "customsDeclarationType",
      title: "报关方式",
      minWidth: "90",
      renderSlot: "customsDeclarationType"
    },
    {
      field: "warehouseProperty",
      title: "仓库属性",
      minWidth: "90",
      sortable: true
    },
    {
      field: "annexNumber",
      title: "附件个数",
      minWidth: "90"
    },

    {
      field: "warehouseName",
      title: "拣货仓库",
      minWidth: "110",
      sortable: true
    },

    {
      field: "tracksStatus",
      title: "最新轨迹",
      minWidth: "160"
    },
    {
      field: "locusUpdateTime",
      title: "轨迹更新时间",
      minWidth: "135",
      formatter: "formatDate",
      sortable: true
    },
    {
      field: "pushOrderTag",
      title: "推单状态",
      minWidth: "110"
    },
    {
      field: "countryRegionName",
      title: "目的地",
      minWidth: "90",
      sortable: true
    },
    {
      field: "transferOrderNumber",
      title: "转单号",
      minWidth: "150",
      renderSlot: "transferOrderNumber"
    },
    {
      field: "courierCompanies",
      title: "快递公司",
      minWidth: "90",
      sortable: true
    },
    {
      field: "warehouseCode",
      title: "仓库代码",
      minWidth: "100"
    },
    {
      field: "receivableFeePrice",
      title: "应收费用",
      minWidth: "90"
    },

    {
      field: "channelName",
      title: "渠道",
      minWidth: "160",
      sortable: true
    },
    {
      field: "agentChannelName",
      title: "代理渠道",
      minWidth: "160"
    },
    {
      field: "itemNumber",
      title: "件数",
      minWidth: "80"
    },
    {
      field: "mark",
      title: "标识",
      minWidth: "80"
    },
    {
      field: "settlementWeight",
      title: "结算重",
      minWidth: "80"
    },
    {
      field: "actualWeight",
      title: "实重",
      minWidth: "80"
    },
    {
      field: "volumeWeight",
      title: "材积重",
      minWidth: "80"
    },
    {
      field: "squaresNumber",
      title: "方数",
      minWidth: "80"
    },
    {
      field: "zipCode",
      title: "邮编",
      minWidth: "90"
    },
    {
      field: "productName",
      title: "品名",
      minWidth: "120"
    },
    {
      field: "materialQualityName",
      title: "材质",
      minWidth: "120"
    },
    // {
    //   field: "companyName",
    //   title: "公司名称",
    //   minWidth: "120"
    // },

    {
      field: "remark",
      title: "客户备注",
      minWidth: "120"
    },
    {
      field: "innerRemark",
      title: "内部备注",
      minWidth: "120"
    },
    {
      field: "customerServiceRemark",
      title: "客服备注",
      minWidth: "120"
    },
    {
      field: "makeInvoiceStatus",
      title: "制作发票",
      minWidth: "120",
      renderSlot: "makeInvoiceStatus",
      sortable: true
    },
    {
      field: "depositTime",
      title: "拣货时间",
      minWidth: "135",
      formatter: "formatDate",
      sortable: true
    },
    {
      field: "bizName",
      title: "业务员",
      minWidth: "90",
      sortable: true
    },
    {
      field: "followName",
      title: "跟单员",
      minWidth: "90",
      sortable: true
    },
    {
      field: "addressType",
      title: "运单类型",
      minWidth: "120",
      fixed: "right",
      renderSlot: "addressType",
      sortable: true
    },
    {
      field: "companyName",
      title: "经营单位",
      minWidth: "100",
      sortable: true
    },
    {
      field: "action",
      title: "操作",
      minWidth: "90",
      renderSlot: "action",
      fixed: "right"
    }
  ],
  "-2": [
    {
      type: "checkbox",
      field: "checkbox",
      minWidth: "50"
    },
    {
      field: "customerName",
      title: "客户简称",
      minWidth: "120",
      sortable: true
    },
    {
      field: "fbaNumber",
      title: "FBA单号",
      minWidth: "140"
    },
    {
      field: "waybillNum",
      title: "运单号",
      minWidth: "260",
      renderSlot: "waybillNum"
    },
    {
      field: "questionType",
      title: "问题类型",
      minWidth: "100"
    },
    {
      field: "workOrderNo",
      title: "工单",
      minWidth: "100"
    },
    {
      field: "trackState",
      title: "运踪状态",
      minWidth: "90",
      renderSlot: "trackState"
    },
    {
      field: "declaredValue",
      title: "申报总值",
      minWidth: "90"
    },
    {
      field: "annexNumber",
      title: "附件个数",
      minWidth: "90"
    },
    {
      field: "mergeNo",
      title: "合并报关号",
      minWidth: "90"
    },
    {
      field: "splitFoamRatio",
      title: "泡比",
      minWidth: "90"
    },
    {
      field: "customsDeclarationType",
      title: "报关方式",
      minWidth: "90",
      renderSlot: "customsDeclarationType"
    },
    {
      field: "warehouseProperty",
      title: "仓库属性",
      minWidth: "90",
      sortable: true
    },
    {
      field: "warehouseName",
      title: "拣货仓库",
      minWidth: "110",
      sortable: true
    },
    {
      field: "tracksStatus",
      title: "最新轨迹",
      minWidth: "160"
    },
    {
      field: "locusUpdateTime",
      title: "轨迹更新时间",
      minWidth: "135",
      formatter: "formatDate",
      sortable: true
    },
    {
      field: "pushOrderTag",
      title: "推单状态",
      minWidth: "110"
    },
    {
      field: "countryRegionName",
      title: "目的地",
      minWidth: "90",
      sortable: true
    },
    {
      field: "transferOrderNumber",
      title: "转单号",
      minWidth: "150",
      renderSlot: "transferOrderNumber"
    },
    {
      field: "courierCompanies",
      title: "快递公司",
      minWidth: "90",
      sortable: true
    },
    {
      field: "warehouseCode",
      title: "仓库代码",
      minWidth: "100"
    },
    {
      field: "receivableFeePrice",
      title: "应收费用",
      minWidth: "90"
    },

    {
      field: "channelName",
      title: "渠道",
      minWidth: "160",
      sortable: true
    },
    {
      field: "agentChannelName",
      title: "代理渠道",
      minWidth: "160"
    },
    {
      field: "itemNumber",
      title: "件数",
      minWidth: "80"
    },
    {
      field: "mark",
      title: "标识",
      minWidth: "80"
    },
    {
      field: "settlementWeight",
      title: "结算重",
      minWidth: "80"
    },
    {
      field: "actualWeight",
      title: "实重",
      minWidth: "80"
    },
    {
      field: "volumeWeight",
      title: "材积重",
      minWidth: "80"
    },
    {
      field: "squaresNumber",
      title: "方数",
      minWidth: "80"
    },
    {
      field: "zipCode",
      title: "邮编",
      minWidth: "90"
    },
    {
      field: "productName",
      title: "品名",
      minWidth: "120"
    },
    {
      field: "materialQualityName",
      title: "材质",
      minWidth: "120"
    },
    // {
    //   field: "companyName",
    //   title: "公司名称",
    //   minWidth: "120"
    // },

    {
      field: "remark",
      title: "客户备注",
      minWidth: "120"
    },
    {
      field: "innerRemark",
      title: "内部备注",
      minWidth: "120"
    },
    {
      field: "customerServiceRemark",
      title: "客服备注",
      minWidth: "120"
    },
    {
      field: "makeInvoiceStatus",
      title: "制作发票",
      minWidth: "120",
      renderSlot: "makeInvoiceStatus",
      sortable: true
    },
    {
      field: "depositTime",
      title: "拣货时间",
      minWidth: "135",
      formatter: "formatDate",
      sortable: true
    },
    {
      field: "bizName",
      title: "业务员",
      minWidth: "90",
      sortable: true
    },
    {
      field: "followName",
      title: "跟单员",
      minWidth: "90",
      sortable: true
    },
    {
      field: "addressType",
      title: "运单类型",
      minWidth: "120",
      fixed: "right",
      renderSlot: "addressType",
      sortable: true
    },
    {
      field: "companyName",
      title: "经营单位",
      minWidth: "100",
      sortable: true
    },
    {
      field: "action",
      title: "操作",
      minWidth: "90",
      renderSlot: "action",
      fixed: "right"
    }
  ]
};
// 统计
export const statisticsColumn: Array<{ field: string; label: string }> = [
  {
    label: "票数",
    field: "shipmentCount"
  },
  {
    label: "件数",
    field: "itemNumberSum"
  },
  {
    label: "客户数",
    field: "customerSum"
  },
  {
    label: "实重",
    field: "actualWeightSum"
  },
  {
    label: "材积重",
    field: "volumeWeightSum"
  },
  {
    label: "结算重",
    field: "settlementWeightSum"
  },
  {
    label: "方数",
    field: "squaresNumberSum"
  },
  {
    label: "应收金额",
    field: "receiveAmountSum"
  }
];
